//  用药方案模型
//  RPMedicinePlan.m
//  yilutongxing
//
//  Created by T&J on 2017/6/18.
//  Copyright © 2017年 YZE. All rights reserved.
//

#import "RPMedicinePlan.h"
#import "RPMedicineSinglePlan.h"

@implementation RPMedicinePlan

+(NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{
             @"desc" : @"description"
             };
}

+(NSDictionary *)mj_objectClassInArray
{
    return @{
             @"medicines" : [RPMedicineSinglePlan class]
             };
}

- (id)copyWithZone:(NSZone *)zone{
    RPMedicinePlan *plan = [[RPMedicinePlan allocWithZone:zone]init];
    plan.id = self.id;
    plan.startTime = [self.startTime copy];
    plan.endTime = [self.endTime copy];
    plan.desc = [self.desc copy];
    plan.userId = [self.userId copy];
    
    NSMutableArray *medicines = [NSMutableArray array];
    for (int i=0; i<self.medicines.count; i++) {
        RPMedicineSinglePlan *splan = [self.medicines[i] copy];
        [medicines addObject:splan];
    }
    plan.medicines = medicines;
    
    return plan;
}

@end
